﻿using UnityEngine;
using System.Collections;

public class ThirdPersonCameraDefinition : CameraDefinitionBase
{
	public Vector2 DistanceFromCharacterOrigin = new Vector2(3.5f, 1.5f);
	public float LookAtVerticalOffset = 1.5f;

	public override string DefinitionInspectorName { get { return "Third Person Camera"; } }

	#region implemented abstract members of CameraDefinitionBase

	public override bool CameraActive()
	{
		return false;
	}

	public override Vector3 GetCameraPosition()
	{
		Vector3 cameraPosition = Vector3.zero;
		CameraController cameraController = CameraController;
		
		cameraPosition = cameraController.LinkTransform.position + -cameraController.LinkTransform.forward * DistanceFromCharacterOrigin.x + cameraController.transform.up * DistanceFromCharacterOrigin.y;
		
		return cameraPosition;
	}

	public override Vector3 GetCameraLookAt()
	{
		CameraController cameraController = CameraController;

		return cameraController.LinkTransform.position + new Vector3(0, LookAtVerticalOffset, 0);
	}

	#endregion

	public ThirdPersonCameraDefinition(CameraController cameraController)
		: base(cameraController) { }
}
